[LIBXC][POWERPC] use O_CREAT on open call for DTB_FILE
authorJimi Xenidis <jimix@watson.ibm.com>
Thu, 8 Feb 2007 11:46:13 +0000 (06:46 -0500)
committerJimi Xenidis <jimix@watson.ibm.com>
Thu, 8 Feb 2007 11:46:13 +0000 (06:46 -0500)
This fixes a bug in the creating of the flat dev tree. If open is used
and O_CREAT not is specified, it will fail if the file has not already
been created. This patch will create the file if it does not exist
already. Which will allow for DomU creation.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
--HG--
extra : transplant_source : Q%CA%40%88N%D8%25%B0%D7%FD%F8%1A%1E%07%8E2E%1BM%22

tools/libxc/powerpc64/mk_flatdevtree.c

index 17085aeca1c878df1821a163a84a90458a985ca4..14af93336a73de3f10d2477837a2ada95a6f8eed 100644 (file)
@@ -618,7 +618,7 @@ int make_devtree(struct ft_cxt *root,
     }
 
     /* write a copy of the tree to a file */
-    if ((dtb_fd = open(DTB_FILE , O_RDWR)) == -1) {
+    if ((dtb_fd = open(DTB_FILE , O_CREAT|O_RDWR)) == -1) {
         PERROR("%s: failed to open file %s", __func__, DTB_FILE);
         goto error;
     }